<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>users</title>
    <style type="text/css">
    table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto}
    table, th, td {border: 1px solid darkslategray;padding: 10px}
    </style>
</head>

<body>
<div style="text-align: center">
    <span style="color: darkslategray; font-size: 30px">欢迎光临！</span>
    <hr/> <table class="list">
    <tr><th>id</th> <th>姓名</th> <th>用户名</th> <th>年龄</th> <th>性别</th> <th>生日</th> <th>备注</th> <th>操作</th> </tr>
    <tr th:each="user, status : ${users}" th:object="${user}">
    <td th:text="${user.id}">1</td>
        <td th:text="*{name}">张三</td>
        <td th:text="*{userName}">zhangsan</td>
        <td th:text="${user.age}">20</td>
        <td th:text="${user.sex} == 1 ? '男': '女'">男</td>
        <td th:text="${#dates.format(user.birthday, 'yyyy-MM-dd')}">1980-02-30</td>
        <td th:text="${user.note}">1</td>
        <td><a th:href="@{/delete(id=${user.id}, userName=*{userName})}">删除</a>
            <a th:href="|/update/${user.id}|">修改</a>
            <a th:href="'/approve/' + ${user.id}">审核</a>
        </td>
    </tr>
</table>
</div>
</body>
</html>